<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="Public/static/font-awesome/css/font-awesome.min.css?v=20141202" rel="stylesheet">
    <link href="Public/Home/css/base.css?v=20141202" rel="stylesheet">
    <link href="Public/Home/css/module.css?v=20141202" rel="stylesheet">
    <link href="Public/Home/css/yitian.css?v=20141202" rel="stylesheet">
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="Public/static/bootstrap/js/html5shiv.js?v=20141202"></script>
    <![endif]-->

    <!--[if lt IE 9]>
    <script type="text/javascript" src="Public/static/jquery-1.10.2.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script type="text/javascript" src="Public/static/jquery-2.0.3.min.js"></script>
    <!--<![endif]-->
    <script type="text/javascript" src="Public/static/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="Public/static/uploadify/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="Public/Home/js/dialog.js?v=20141202"></script>
    <script type="text/javascript" src="Public/Home/js/admin_common.js?v=20141202"></script>
    <script type="text/javascript" src="Public/Home/js/admin_image.js?v=20141202"></script>
</head>
<body id="login_body">
<div class="login_top_btn"></div>
<section class="login_box">
    <form class="login-form" action="./checkLogin" method="post">
        <a href="#">
            <div class="logo_icon"></div>
            <div class="logo_text"><span class="beta"></span></div>
        </a>
        <div class="form_title">
            简洁强大的微信公众平台开发框架
        </div>
        <div class="form_body">
            <div class="input_panel">
                <div class="control-group">
                    <label class="control-label" for="username">用户名</label>

                    <div class="controls">
                        <span class="fa fa-user"></span>
                        <input type="text" id="username" class="span3" placeholder="请输入用户名" ajaxurl="/member/checkUserNameUnique.html" errormsg="请填写1-16位用户名" nullmsg="请填写用户名" datatype="*1-16" name="username">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="password">密码</label>

                    <div class="controls">
                        <span class="fa fa-key"></span>
                        <input type="password" id="password" class="span3" placeholder="请输入密码" errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password" >
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="code">验证码</label>

                    <div class="controls">
                        <span class="fa fa-keyboard-o"></span>
                        <input type="text" id="code" class="span3" style="width:60%" placeholder="请输入验证码" errormsg="请填写5位验证码" nullmsg="请填写验证码" datatype="*4-4" name="code" value="">
                        <a href="javascript:;" class="reloadverify_a">换一张?</a>
                    </div>
                </div>

            </div>

            <div class="control-group">
                <label class="control-label"></label>

                <div class="controls">
                    <img class="verifyimg reloadverify" alt="点击切换"
                         src="./code" style="cursor:pointer;height:50px">
                </div>
            </div>
            <div class="controls Validform_checktip text-warning"></div>
            <div class="control-group">
                <div class="controls">
                    <input type="checkbox" id="checkbox" class="regular-checkbox"/><label for="checkbox"></label>
                    自动登录
                </div>
                <div class="controls">
                    <button type="submit" class="btn btn-large">登 录</button>
                </div>
            </div>
        </div>
    </form>
</section>

<script type="text/javascript">
    $(document)
            .ajaxStart(function () {
                $("button:submit").addClass("log-in").attr("disabled", true);
            })
            .ajaxStop(function () {
                $("button:submit").removeClass("log-in").attr("disabled", false);
            });


    $("form").submit(function () {
        var self = $(this);
        $.post(self.attr("action"), self.serialize(), success, "json");
        return false;

        function success(data) {
            if (data.errno == 0) {
                window.location.href = "./home";
            } else {
                self.find(".Validform_checktip").text(data.info);
                //刷新验证码
                $(".reloadverify").click();
            }
        }
    });

    $(function () {
        var verifyimg = $(".verifyimg").attr("src");
        $(".reloadverify,.reloadverify_a").click(function () {
            if (verifyimg.indexOf('?') > 0) {
                $(".verifyimg").attr("src", verifyimg + '&random=' + Math.random());
            } else {
                $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/, '') + '?' + Math.random());
            }
        });
        $('input').focus(function () {
            $(this).parent().find('.fa').css('color', '#1dbd03');
        })
        $('input').blur(function () {
            $(this).parent().find('.fa').css('color', '#aaa');
        })
    });
</script>
</body>
</html>
